package org.example;

import redis.clients.jedis.JedisPubSub;

public class SubscriberListener extends JedisPubSub {
    @Override
    public void onMessage(String channel, String message) {
        super.onMessage(channel, message);
        System.out.println("get"+message+"from:"+channel);
    }

    @Override
    public void onPMessage(String pattern, String channel, String message) {
        super.onPMessage(pattern, channel, message);
        System.out.println("get"+message+"from pattern:"+pattern);
    }

    @Override
    public void onSubscribe(String channel, int subscribedChannels) {
        super.onSubscribe(channel, subscribedChannels);
        System.out.println("已订阅频道:"+channel);
    }

    @Override
    public void onPSubscribe(String pattern, int subscribedChannels) {
        super.onPSubscribe(pattern, subscribedChannels);
        System.out.println("已订阅模式:"+pattern);
    }

}
